package com.mpc.manager;

import java.util.HashMap;
import java.util.Map;

import com.mpc.beans.AppItem;

public class AppItemManager {
    public static int ITEM_1_ZH = 1;
    public static int ITEM_1_EN = 2;

    public static int ITEM_2_ZH = 11;
    public static int ITEM_2_EN = 12;

    public static int ITEM_3_ZH = 21;
    public static int ITEM_3_EN = 22;

    public static int ITEM_4_ZH = 31;
    public static int ITEM_4_EN = 32;

    public static int ITEM_5_ZH = 41;
    public static int ITEM_5_EN = 42;

    private static AppItemManager sMgr = null;

    private String mServletCtx = null;
    private Map<Integer, AppItem> mAppMap = new HashMap<Integer, AppItem>();

    private AppItemManager(String servletCtx) {
        mServletCtx = servletCtx;
        addItem1();
        addItem2();
        addItem3();
        addItem4();
        addItem5();
    }

    public static AppItemManager getInstance(String servletCtx) {
        if (sMgr == null) {
            sMgr = new AppItemManager(servletCtx);

        }
        return sMgr;
    }

    private void addItem1() {
        String title = "CLARC";
        String image = "images/item_main_clarc.png";
        String content = "This grid-based genre mix combines complex spatial puzzles with arcade style action elements and an epic storyline.<br/>"
                + "As the story unfolds, the nerdy forklift robot Clarc will encounter partying robots, attractive nuclear missiles and intoxicated supercomputers.<br/>"
                + "He sets out to repair his production facility on Mars and fights to rescue his friends from the intruding spaceship, M.O.T.H.E.R.";
        mAppMap.put(ITEM_1_EN, new AppItem(mServletCtx, title, content, image));
        mAppMap.put(ITEM_1_ZH, new AppItem(mServletCtx, title, content, image));
    }

    private void addItem2() {
        String title = "Avengers Alliance";
        String image = "images/item_main_avengers_alliance.png";
        String content = "快來擔任神盾局的探員，與復仇者、蜘蛛人和 X 戰警聯手組隊執行任務。發揮同位素-8 的強大力量，趕在末日博士、邪神洛基和世界上最強大的反派惡棍們之前展開行動。<br/>"
                + "在這款全新遊戲中，招募雷神索爾、鋼鐵人、美國隊長和浩克等你喜愛的 Marvel 英雄，整裝待發對抗未知的威脅！";
        mAppMap.put(ITEM_2_EN, new AppItem(mServletCtx, title, content, image));
        mAppMap.put(ITEM_2_ZH, new AppItem(mServletCtx, title, content, image));
    }

    private void addItem3() {
        String title = "Slings Shot";
        String image = "images/item_main_slingshot.png";
        String content = "于短期的名字弹弓的勇者，拉动人物攻击敌人，操作简单，只拍超爽快的动作！<br/>"
                + "它成为冒险者，并即将在旅途离开找到“弹弓”的传说武器 -<br/>"
                + "激情流露的〜〜〜指尖，勇气。冒险家谁，与双塔的目标上升到永恒的尽头，飞和放弃玩！ 〜〜〜<br/>"
                + "Suribure就是中，玩家将成为冒险家，一个史诗般的冒险幻想RPG出游找到“弹弓”的传说武器是.";
        mAppMap.put(ITEM_3_EN, new AppItem(mServletCtx, title, content, image));
        mAppMap.put(ITEM_3_ZH, new AppItem(mServletCtx, title, content, image));
    }

    private void addItem4() {
        String title = "Run Away From Jungle";
        String image = "images/item_main_run_away.png";
        String content = "这是一款画面非常棒的飞行跑酷游戏。在这个魔幻世界里一只漂亮的小鸟正受到凶猛飞龙的追捕。你要控制这只身手敏捷的小鸟逃脱恶龙。";
        mAppMap.put(ITEM_4_EN, new AppItem(mServletCtx, title, content, image));
        mAppMap.put(ITEM_4_ZH, new AppItem(mServletCtx, title, content, image));
    }

    private void addItem5() {
        String title = "Towers";
        String image = "images/item_main_towers.png";
        String content = "全新的单机角色扮演游戏，打破常规的游戏模式，关卡丰富，系统全面附魔，精炼，战力成就，<br/>"
                + "魔塔成就等各种特色系统应有尽有！游戏中抛除了烦琐的任务、老套的剧情，在这里只有无尽的挑战！";
        mAppMap.put(ITEM_5_EN, new AppItem(mServletCtx, title, content, image));
        mAppMap.put(ITEM_5_ZH, new AppItem(mServletCtx, title, content, image));
    }

    public AppItem getAppItem(int i) {
        return mAppMap.get(i);
    }

}
